//
//  ZGLSearchTitleView.m
//  Faker
//
//  Created by dllo on 15/10/31.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ZGLSearchTitleView.h"


@implementation ZGLSearchTitleView


- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.goodsButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.channelButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.lineLabel = [[UILabel alloc] init];
        [self addSubview:self.lineLabel];
        [self addSubview:self.goodsButton];
        [self addSubview:self.channelButton];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.backgroundColor = backColor;
    [self.goodsButton setFrame:CGRectMake(0, 0, ScaleX * 375 / 2, self.frame.size.height - ScaleY * 2)];
    [self.goodsButton setTitle:@"精品" forState:(UIControlStateNormal)];
    [self.goodsButton setSelected:YES];
    [self.goodsButton setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [self.goodsButton setTitleColor:naviColor forState:UIControlStateSelected];
    self.goodsButton.backgroundColor = foreColor;
    self.goodsButton.titleLabel.font = [UIFont systemFontOfSize:14];
    [self.channelButton setFrame:CGRectMake(ScaleX * 375 / 2, 0, ScaleX * 375 / 2, self.frame.size.height - ScaleY * 2)];
    [self.channelButton setTitle:@"频道" forState:(UIControlStateNormal)];
    self.channelButton.titleLabel.font = [UIFont fontWithName:@"CourierNewPSMT" size:14];
    self.channelButton.backgroundColor = foreColor;
    
    [self.channelButton setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [self.channelButton setTitleColor:naviColor forState:UIControlStateSelected];
    [self.lineLabel  setFrame:CGRectMake(0, self.frame.size.height - ScaleY * 2, ScaleX * 375 / 2, ScaleY * 2)];
    self.lineLabel.backgroundColor = naviColor;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
